import java.util.Scanner;

//给定一个包含 [0, n] 中 n 个数的数组 nums ，找出 [0, n] 这个范围内没有出现在数组中的那个数。
public class test7 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] nums = new int[n];
        for(int i=0;i<n;i++){
            nums[i] = in.nextInt();
        }
        System.out.println(missingNumber(nums));
    }

    //位运算
    public static int missingNumber1(int[] nums) {
        int result1 = 0,result2=0;
        int n = nums.length;
        for (int i = 0; i < n; i++) {
            result1^=nums[i];
        }
        for (int i = 0; i <=n ; i++) {
            result2^=i;
        }
        result1^=result2;
        return result1;
    }

    //高斯求和
    public static int missingNumber(int[] nums) {
        int n = nums.length;
        int sum = (1+n)*n/2;
        int sum2 = 0;
        for (int i = 0; i < n; i++) {
            sum2+=nums[i];
        }
        return sum-sum2;
    }
}
